/*
 * @Author: qin
 * @Date:   2018-08-28
 * +----------------------------------------------------------------------
 * | admin [ 后台管理系统公共配置信息 ]
 * | 数据格式化
 * +----------------------------------------------------------------------
 */
layui.define(['jquery'], function (exports) {
    var $ = layui.jquery;
    var dataFormat = {
        data: [],
        drawingDataInit: function (data) {
            dataFormat.data = [];
            var i = 2;
            $.each(data, function (index, item) {
                var authorityId = i++;
                item.parentId = -1;
                item.authorityId = authorityId;
                dataFormat.data.push(item);
                $.each(item.allVersion, function (index, item) {
                    item.parentId = authorityId;
                    item.authorityId = i++;
                    dataFormat.data.push(item);
                });
            });
            return dataFormat.data;
        }
    };
    exports('dataFormat', dataFormat);
});